//
//  MAPYPingServe.h
//  Mars Proxy
//
//  Created by PowerfullClean on 2023/10/18.
//

#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import "MAPYPingTool.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, MAPYPingStatus) {
    MAPYPingStatusDidStart,
    MAPYPingStatusDidFailToSendPacket,
    MAPYPingStatusDidReceivePacket,
    MAPYPingStatusDidReceiveUnexpectedPacket,
    MAPYPingStatusDidTimeout,
    MAPYPingStatusError,
    MAPYPingStatusFinished,
};

@interface MAPYPingModel : NSObject

@property(nonatomic) NSString *originalAddress;
@property(nonatomic, copy) NSString *IPAddress;

@property(nonatomic) NSUInteger dateBytesLength;
@property(nonatomic) double     timeMilliseconds;
@property(nonatomic) NSInteger  timeToLive;
@property(nonatomic) NSInteger  ICMPSequence;

@property(nonatomic) MAPYPingStatus status;

+ (NSString *)statisticsWithPingItems:(NSArray *)pingItems;

@end
@interface MAPYPingServe : NSObject
@property(nonatomic) double timeoutMilliseconds;

+ (MAPYPingServe *)startPingAddress:(NSString *)address
                      callbackHandler:(void(^)(MAPYPingModel *pingItem, NSArray *pingItems))handler;

@property(nonatomic) NSInteger  maximumPingTimes;
- (void)mapy_stop;
@end

NS_ASSUME_NONNULL_END

